package com.woniuxy.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.woniuxy.dao.ManagerDao;
import com.woniuxy.entity.Member;
import com.woniuxy.service.MemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Auther: X  <br/>
 * Date: 2021/2/23:14:52  <br/>
 * Description: 管理员查询结果
 */
@Service
public class MemberServiceImpl implements MemberService {

    @Autowired(required = false)
    ManagerDao managerDao;

    @Override
    public PageInfo<Member> selectAllMes(Integer page, Integer limit) {
        PageHelper.startPage(page,limit);
        List<Member> members = managerDao.selectAllMes();
        PageInfo<Member> pageInfo = new PageInfo<>(members);
        return pageInfo;
    }

    @Override
    public PageInfo<Member> selectLike(String name,Integer page,Integer limit) {
        PageHelper.startPage(page,limit);
        List<Member> members = managerDao.selectLike(name);
        PageInfo<Member> pageInfo = new PageInfo<>(members);
        return pageInfo;
    }

    @Override
    public String selectByAccount(String account) {
        return this.managerDao.selectByAccount(account);
    }
}
